<template>
	<view>
		<view style="text-align:center;">
			<view class="NoticeUserHeadPic">
				<image :src="baomingUser.WxHeadPic"></image>
			</view>
			<view style="text-align: center;padding:50rpx;">{{ baomingUser.NickName }}</view>
			<view style="width:40%;float:left">
				<button class="contactBtn">查看资料</button>
			</view>
		</view>
		<view class="flexbc" style="clear:both;padding:50rpx;">
			<view style="width:40%;float:left">
				<button class="contactBtn">极速联系</button>
			</view>
			<view style="width:40%;float:right">
				<button class="chatBtn" @click="chatMsg">立即沟通</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ArtisterID: 0,
				baomingUser: {}
			};
		},
		onLoad(options) {
			this.ArtisterID = options.ArtisterID
			this.getBaomingUser()
		},
		methods: {
			getBaomingUser() {
				this.$httpost('/Artister/Info', {
					ArtisterID: this.ArtisterID
				}).then(res => {
					// console.log('baomingUser', res);
					if (res.code == 200) {
						if (res.data !== 0) {
							this.baomingUser = res.data.ArtisterInfo
						}
					}
				});
			},
			chatMsg() {
				let LoginInfo = uni.getStorageSync("isLogin");
				if (LoginInfo.UserID == this.ArtisterID) {
					uni.showModal({
						content: "自己不能和自己对话！"
					})
				} else {
					this.$httpost('/Message/MeetMsgGroup', {
						UserID: LoginInfo.UserID,
						ArtisterID: this.ArtisterID
					}).then(res => {
						// console.log('MeetMsgGroup', res);
						if (res.code == 200 && res.data.MsgGroupID !== null) {
							this.$common.goNavPage('/messagePages/pages/msgpage?MsgGroupID=' + res.data.MsgGroupID)
						}

					});
				}
			},
		}
	}
</script>

<style lang="scss">
	.NoticeUserHeadPic {
		width: 150rpx;
		height: 150rpx;
		border-radius: 150rpx;
		background-color: #CCC;
		margin: auto
	}

	.NoticeUserHeadPic image {
		width: 150rpx;
		height: 150rpx;
		border-radius: 150rpx;
	}

	.contactBtn {
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		background-color: #e0e0e0;
		color: #000;
		font-size: 36rpx;
	}

	.chatBtn {
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		background-color: $globalColor;
		color: #000;
		font-size: 36rpx;
	}
</style>